<template>
  <div class="about">
    <el-tooltip content="GitHub" effect="light" placement="top-start">
      <h2><a href="https://github.com/YouXam/RookieWiki" target="_blank">RookieWiki</a></h2>
    </el-tooltip>
    <el-divider></el-divider>
    <h3>开发者</h3>
    <ul>
      <li>
        <el-tooltip content="张" effect="light" placement="top-end">
          <span>YouXam</span>
        </el-tooltip>
        <el-divider direction="vertical"></el-divider>
        <el-tooltip content="YouXam" effect="light" placement="top">
          <a href="https://github.com/YouXam/" target="_blank">GitHub</a>
        </el-tooltip>
        <el-divider direction="vertical"></el-divider>
        <el-tooltip content="2691169221" effect="light" placement="top-start">
          <a href="tencent://message/?Menu=yes&uin=2691169221">QQ</a>
        </el-tooltip>
      </li>
      <li>
        <el-tooltip content="落羽重明" effect="light" placement="bottom-end">
          <span>Lycm</span>
        </el-tooltip>
        <el-divider direction="vertical"></el-divider>
        <el-tooltip content="2417003944" effect="light" placement="bottom-start">
          <a href="tencent://message/?Menu=yes&uin=2417003944">QQ</a>
        </el-tooltip>
      </li>
    </ul>
    <!--
    <h3>开发历史</h3>
    <el-timeline>
      <el-timeline-item v-for="(commit, index) in commits" :key="index" :timestamp="toStamp(commit.commit.committer.date)" placement="top">
        <el-card>
          <h2><a :href="commit.html_url " target="_blank">{{ commit.commit.message }}</a></h2>
          <div>
            <el-avatar :size="20" :src="commit.committer.avatar_url">
              <img src="../assets/person.png"/>
            </el-avatar>
            <a style="color:#888;margin-left:10px;margin-top:0px;" :href="commit.committer.html_url" target="_blank">{{ commit.commit.committer.name }}</a>
          </div>
        </el-card>
      </el-timeline-item>
    </el-timeline>
    -->
  </div>
</template>

<script>
// @ is an alias to /src
export default {
  name: 'about',
  data () {
    return {
      // commits: []
    }
  }/*,
  created () {
    this.axios.get('https://api.github.com/repos/YouXam/RookieWiki/commits?per_page=10000')
      .then((res) => {
        this.commits = res.data
        this.commits.forEach((e, i) => {
          this.commits[i].commit.message = e.commit.message.replace(/\[(.*?)\]\(.*?\)/g, '$1')
        })
      })
      .catch((err) => {
        this.$notify.error({
          title: '在与GitHub请求数据时出现错误',
          message: err
        })
      })
  },
  methods: {
    toStamp: function (dateStr) {
      const date = new Date(dateStr)
      const y = date.getFullYear()
      const mo = date.getMonth() + 1
      const d = date.getDate()
      const h = date.getHours()
      const m = date.getMinutes()
      const s = date.getSeconds()
      return y + '/' + (mo < 10 ? '0' + mo : mo) + '/' + (d < 10 ? '0' + d : d) + ' ' + (h < 10 ? '0' + h : h) + ':' + (m < 10 ? '0' + m : m) + ':' + (s < 10 ? '0' + s : s)
    } */
}
</script>
<style scoped>
ul{
  list-style-type: none;
}
ul li{
  margin:10px;
}
</style>
